fo = open('hello.txt', 'w+')
ls = input("请输入一段文字：")
fo.writelines(ls)
for line in fo:
    print(line)
fo.close()

